package Fragment;

import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.provider.ContactsContract;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.hjh.qinxin.AboutActivity;
import com.hjh.qinxin.FeedbackActivity;
import com.hjh.qinxin.LoginActivity;
import com.hjh.qinxin.R;


public class MineFragment extends Fragment {


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View root = inflater.inflate(R.layout.fragment_mine, container, false);
        initView(root);
        return root;
    }
    private void initView(View root){
        TextView tologin = root.findViewById(R.id.to_login);
        ImageView browse = root.findViewById(R.id.browse_go);
        ImageView share = root.findViewById(R.id.share_go);
        ImageView about = root.findViewById(R.id.about_go);
        ImageView opinion = root.findViewById(R.id.opinion_go);
        ImageView set = root.findViewById(R.id.set_go);

        tologin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), LoginActivity.class);
                startActivity(intent);
            }
        });

        opinion.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), FeedbackActivity.class);
                startActivity(intent);
            }
        });

        set.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

            }
        });

        about.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), AboutActivity.class);
                startActivity(intent);
            }
        });

    }
}